1. Field of the Invention
The present invention is directed to the virtualization of data processing systems to provide multiple execution environments. More particularly, the invention concerns the allocation of mapped memory to and among virtual execution environments.
2. Description of the Prior Art
By way of background virtualization is a technique whereby the resources of a data processing system are divided into multiple execution environments. Virtualization comes in many flavors. One approach, known as operating system-level virtualization, is a virtualization technology that partitions the application space supported by a single operating system into multiple small virtual application environments. Each virtual application environment may be assigned a share of physical and logical resources managed by the underlying operating system. Such resource allocations may include CPU time, memory, I/O (Input/Output) ports, network devices, disk partitions, etc. Depending on the particular virtualization implementation being used, each virtual application environment may have its own process tree, file system directory tree, users and groups, system libraries, network addresses, disk space, etc.
One advantage of operating system-level virtualization is that the resources assigned to each virtual application environment can be selectively allocated in order to provide differentiated quality of service guarantees. However, this requires some level of resource control capability in the underlying operating system. The sharing of mapped memory among virtual application environments has heretofore been a problem when trying to manage resource allocations. This is due to the overhead associated with storing and maintaining memory accounting structures that map physical page frames to each virtual application environment. Such mappings are needed in order to track the amount of physical memory being used by the virtual application environments at any given time.
The conventional approach is to either statically assign ownership of a single memory page to a single virtual application environment or to keep a list of virtual application environments and associate the list with the page. This is typically done by appending ownership information to page frame control structures (also known as page descriptors) that are used to keep track of the page frames. For example, as shown in FIG. 1, each page frame used by processes associated with a particular virtual application environment has a field in its page frame control structure that holds a pointer which maps to the virtual application environment. This approach tends to have a cost of about one word per page of memory in the system. For a 64 GB system with 4 KB memory page frames, there are approximately 16 million page frames each having its own page frame control structure. Even without the virtual application environment mapping information, the amount of memory required to store this many page frame control structures can easily represent 1% of the system memory (depending on page frame control structure size), which is 640 MB of memory in a 64 GB system. Increasing the size of each page frame control structure to support mapping to virtual application environments requires additional memory. In the above example where there are 16 million page frame control structures, the additional memory utilization may add many megabytes of memory that would be otherwise available for use by application processes.
As additionally shown in FIG. 1, it is also conventional in some operating systems (such as Linux® kernel version 2.6) to map page frames to memory management entities that are associated with processes. These memory management entities are known as memory descriptors and they define the virtual address space of their associated process. The mapping of page frames to such entities is known as reverse mapping. It is used by pageout algorithms to determine the virtual addresses associated with page frames that are being reallocated, swapped out or otherwise manipulated, and to efficiently locate and invalidate the page table entries containing the virtual address/page frame translations for such page frames.
There is presently a need for an improved technique for controlling memory allocation among virtual application environments in an operating system-level virtualization system. What is required is a solution that allows memory allocations to virtual application environments to be modified in response to changes in physical memory availability, with minimal overhead being required to track the memory assignments to the various virtual application environments. Applicant submits that a solution which takes advantage of existing page frame reclamation reverse mapping capabilities would be of particular interest.